﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RR {
    public class Thumbnail_cube : MonoBehaviour
    {
        public float speed;
        public static bool isPlay = true;
        // Use this for initialization
        void Start()
        {

        }

        // Update is called once per frame
        void Update()
        {
            if (isPlay)
            {
                transform.position += Vector3.forward * speed * Time.deltaTime;

                if (transform.position.z > 10f)
                {
                    transform.position -= Vector3.forward * 20f;
                }
            }
        }
    }
}

